﻿package net.ssta.core.db;

import java.sql.Connection;
import java.sql.SQLException;

/**
 * 提供数据库连接的工具类
 * @author qiuzhl
 *
 */
public class DBConnectionProvider
{
	private static DBConnectionLocator m_locator = new DBConnectionLocator();
	/**
	 * 根据指定的数据源名称获取数据库连接实例，此数据源必须是应用服务器或者common_component.xml中配置
	 * @param jndi
	 * @return
	 * @throws SQLException 
	 * @throws DBException
	 */
	public static Connection getConnection(String jndi) throws SQLException
	{
		return m_locator.getConnection(jndi);
	}
}
